package sel.me.websocket.learning.controller;

import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import sel.me.websocket.learning.domain.AdminUserDO;

/**
 * Created by rajeevkumarsingh on 24/07/17.
 */
@Controller
@RequestMapping("/websocket/page")
public class PageController {

	@GetMapping("/index")
	public ModelAndView index(){
		ModelAndView modelAndView = new ModelAndView("index");
//		AdminUserDO admin =  (AdminUserDO)SecurityUtils.getSubject().getSession().getAttribute("currentUser");
//        System.out.println(admin);
//		
//        modelAndView.addObject("user", admin);
	    return modelAndView;
	}
	
	@GetMapping("/login")
	public ModelAndView login(){
		ModelAndView modelAndView = new ModelAndView("login");
		
		
	    return modelAndView;
	}
	
	
	@GetMapping("/chat")
	public ModelAndView chat(){
		ModelAndView modelAndView = new ModelAndView("test");
		
		
	    return modelAndView;
	}

}
